﻿using DevExpress.XtraBars;
using DevExpress.XtraBars.Ribbon;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DevMy.PublicSetUp
{
    public class Class_RibbonControl
    {
        public void SetRibbonPage(RibbonPage ribbonPage)
        {
            ribbonPage.Appearance.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            ribbonPage.Appearance.Options.UseFont = true;
        }

        public void SetRibbonControl(RibbonControl ribbonControl)
        {
            foreach (DevExpress.XtraBars.Ribbon.RibbonPage item in ribbonControl.Pages)
            {
                SetRibbonPage(item);
            }
            foreach (BarItem item in ribbonControl.Items)
            {
                SetBarButtonItem(item);
            }

        }
        public void SetBarButtonItem(BarItem barItem)
        {
            barItem.ItemAppearance.Normal.Font = new System.Drawing.Font("Tahoma", 8.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            barItem.ItemAppearance.Normal.Options.UseFont = true;
        }
    }
}
